package com.lyj.controller;

import com.lyj.pojo.Vacation;
import com.lyj.service.VacationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class VacationController {

    @Autowired
    VacationService vacationService;

    //查询全部请假信息
    @RequestMapping("/queryAllVacation")
    @ResponseBody
    public List<Vacation> queryAllVacation(){

        List<Vacation> vacationList = vacationService.queryAllVacation();
        return vacationList;
    }
    //关键字搜索请假信息
    @RequestMapping("/queryVacationByName")
    @ResponseBody
    public List<Vacation> queryVacationByName(String username){

        List<Vacation> vacationList = vacationService.queryVacationByName(username);
        return vacationList;
    }
    //修改护工请假信息updateVacation
    //之前写过

//删除护工请假信息
    @RequestMapping("/delVacationByVacaId")
    @ResponseBody
    public Boolean delVacationByVacaId(int vacationId){
        Boolean aBoolean = vacationService.delVacationByVacaId(vacationId);
        return aBoolean;
    }







}
